{% extends "base.html" %}
{% block head %}
{{ super() }}
{% endblock %}
{% block content %}
<div class="container">
    <h1>Create Map</h1>
    <form method="POST">
        <div class="form-group">
            <label for="name">Name</label>
            <input type="text" class="form-control" id="name" name="name" required>
        </div>
        <div class="form-group">
            <label for="table">Table</label>
            <select class="form-control" id="table" name="table" required>
                {% for table in tables %}
                <option value="{{ table.id }}&&{{ table.family }}">{{ table.name }} - {{ table.family}}</option>
                {% endfor %}
            </select>
        </div>
        {{ form.csrf_token }}
        <div class="form-group">
            {{ form.type.label }}
            {{ form.type(class="form-control") }}
            {% if form.type.errors %}
                <ul class="errors">
                    {% for error in form.type.errors %}
                        <li>{{ error }}</li>
                    {% endfor %}
                </ul>
            {% endif %}
        </div>
        <div class="form-group">
            {{ form.map_type.label }}
            {{ form.map_type(class="form-control") }}
            {% if form.map_type.errors %}
                <ul class="errors">
                    {% for error in form.map_type.errors %}
                        <li>{{ error }}</li>
                    {% endfor %}
                </ul>
            {% endif %}
            </div>
            <div class="form-group">
        {{ form.description.label }}
        {{ form.description(class="form-control") }}
        {% if form.description.errors %}
            <ul class="errors">
                {% for error in form.description.errors %}
                    <li>{{ error }}</li>
                {% endfor %}
            </ul>
        {% endif %}
        </div>
        <button type="submit" class="btn btn-primary">Create</button>
    </form>
</div>
{% endblock %}